@model EIMS.Models.Department

@{
    ViewData["Title"] = "部门详情";
}

<div class="container-fluid px-4">
    <h1 class="mt-4">@ViewData["Title"]</h1>
    <ol class="breadcrumb mb-4">
        <li class="breadcrumb-item"><a asp-controller="Home" asp-action="Index">首页</a></li>
        <li class="breadcrumb-item"><a asp-controller="Departments" asp-action="Index">部门管理</a></li>
        <li class="breadcrumb-item active">部门详情</li>
    </ol>
    
    <div class="card mb-4">
        <div class="card-header">
            <i class="fas fa-info-circle me-1"></i>
            部门信息
        </div>
        <div class="card-body">
            <dl class="row">
                <dt class="col-sm-2">
                    @Html.DisplayNameFor(model => model.Name)
                </dt>
                <dd class="col-sm-10">
                    @Html.DisplayFor(model => model.Name)
                </dd>
                <dt class="col-sm-2">
                    @Html.DisplayNameFor(model => model.Description)
                </dt>
                <dd class="col-sm-10">
                    @Html.DisplayFor(model => model.Description)
                </dd>
                <dt class="col-sm-2">
                    @Html.DisplayNameFor(model => model.CreatedAt)
                </dt>
                <dd class="col-sm-10">
                    @Model.CreatedAt.ToString("yyyy-MM-dd HH:mm:ss")
                </dd>
                <dt class="col-sm-2">
                    @Html.DisplayNameFor(model => model.UpdatedAt)
                </dt>
                <dd class="col-sm-10">
                    @(Model.UpdatedAt.HasValue ? Model.UpdatedAt.Value.ToString("yyyy-MM-dd HH:mm:ss") : "-")
                </dd>
            </dl>
            
            <div class="mt-3">
                <a asp-action="Index" class="btn btn-secondary">返回列表</a>
                @if (User.IsInRole("Admin") || User.IsInRole("Manager"))
                {
                    <a asp-action="Edit" asp-route-id="@Model.Id" class="btn btn-primary">
                        <i class="fas fa-edit me-1"></i> 编辑
                    </a>
                }
            </div>
        </div>
    </div>
</div> 